#pragma once
#include "DXAMLCommon.h"
#include "CGrid.h"

class CHardwareCompositor;

class CSwapChainBackgroundPanel :
	public CGrid
{

protected: 
	CSwapChainBackgroundPanel(CCoreServices * pCore);
protected: 
	virtual ~CSwapChainBackgroundPanel();
public: 
	virtual XUINT32 GetTypeIndex() const;
	static HRESULT Create(CDependencyObject * * ppObject, CREATEPARAMETERS * pCreate);
	virtual HRESULT SetValue(CDependencyProperty * pdp, CValue * pValue);
	HRESULT SetSwapChain(struct IUnknown * pSwapChain);
	HRESULT InsertSwapChainIntoScene(struct ICoreRenderTarget * pICoreRenderTarget, CHardwareCompositor * pCompositor);
	XBOOL HasSwapChain();
	HRESULT PreRender();
	virtual XBOOL ParticipatesInManagedTreeInternal();
protected: 
	virtual HRESULT PreTreeParentUpdated(CDependencyObject * pNewParent);
	virtual HRESULT PostTreeParentUpdated(CDependencyObject * pNewParent);
	virtual HRESULT LeaveImpl(CDependencyObject * pNamescopeOwner, struct LeaveParams params);
	virtual HRESULT GenerateContentBounds(struct XRECTF_RB * pBounds);
	virtual HRESULT HitTestLocalInternal(const HitTestPolygon & target, XBOOL * pHit);
	virtual HRESULT HitTestLocalInternal(const struct XPOINTF & target, XBOOL * pHit);
private: 
	struct IUnknown * m_pISwapChain;
	XBOOL m_forceUpdate;


};
